<template>
  <view class="page-view">
    <view class="class-item">
      <view class="item-title">
        <text>{{ dataItem.name }}666</text>
      </view>
      <view class="item-container">
        <view class="thumb-box" v-for="(item1, index1) in dataItem.foods" :key="index1" @click="clickMenu(item1)">
          <image class="item-menu-image" :src="item1.icon" mode=""></image>
          <view class="item-menu-name">{{ item1.name }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>

const props = defineProps({
  data: {
    type: Array,
    default: () => {
      return [];
    }
  }
});

const emit = defineEmits('selected');

const dataItem = ref(props.data);

const menuOperate = inject('menuOperate');
function clickMenu(menu) {
  menuOperate('click-sku', menu);
}


</script>

<style lang="scss" scoped>
.page-view {
      padding: 16rpx;
    }

    .class-item {
      margin-bottom: 30rpx;
      background-color: #fff;
      padding: 16rpx;
      border-radius: 8rpx;
    }

    .item-title {
      font-size: 26rpx;
      color: $u-main-color;
      font-weight: bold;
    }

    .item-menu-name {
      font-weight: normal;
      font-size: 24rpx;
      color: $u-main-color;
    }

    .item-container {
      display: flex;flex-wrap: wrap;
    }

    .thumb-box {
      width: 33.333333%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      margin-top: 20rpx;
    }

    .item-menu-image {
      width: 120rpx;
      height: 120rpx;
    }
</style>